package a_test;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zy on 2019/7/26.
 */
public class CompileConstant {

    public static void main(String[] args) {
        System.out.println(Test.a);
        System.out.println(Test.c);
    }

}

///
///编译型常量和运行时常量的区别：编译期常量不依赖类，不会引起类的初始化；而运行时常量依赖类，会引起类的初始化。
///
class Test {
    static {
        System.out.println("Class Test Was Loaded !");
    }
    public static final int a =10;
    public static final int c = "test".length();
}